package android.slc.appdb.sys.service;

import android.slc.appdb.sys.entity.CsDictType;
import android.slc.box.db.service.DbEntityMapper;
import cn.hutool.core.collection.CollectionUtil;
import io.reactivex.rxjava3.annotations.NonNull;

import java.util.Comparator;
import java.util.List;

/**
 * 字典类型Mapper
 */
public interface CsDictTypeMapper extends DbEntityMapper<CsDictType> {

    @Override
    default List<CsDictType> getAllList() {
        List<CsDictType> csDictTypeList = DbEntityMapper.super.getAllList();
        CollectionUtil.sort(csDictTypeList, Comparator.comparingInt(CsDictType::getSort));
        return csDictTypeList;
    }

    CsDictType findDictTypeByDictType(@NonNull String dictType);
}
